3.1.63 \(\int \frac {\tan ^3(c+d x)}{(a+a \sin (c+d x))^2} \, dx\) [63]

Optimal. Leaf size=104 \[ -\frac {\tanh ^{-1}(\sin (c+d x))}{8 a^2 d}+\frac {a}{12 d (a+a \sin (c+d x))^3}-\frac {1}{4 d (a+a \sin (c+d x))^2}+\frac {1}{16 d \left (a^2-a^2 \sin (c+d x)\right )}+\frac {3}{16 d \left (a^2+a^2 \sin (c+d x)\right )} \]

[Out]

-1/8*arctanh(sin(d*x+c))/a^2/d+1/12*a/d/(a+a*sin(d*x+c))^3-1/4/d/(a+a*sin(d*x+c))^2+1/16/d/(a^2-a^2*sin(d*x+c)
)+3/16/d/(a^2+a^2*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2786, 90, 212} \begin {gather*} \frac {1}{16 d \left (a^2-a^2 \sin (c+d x)\right )}+\frac {3}{16 d \left (a^2 \sin (c+d x)+a^2\right )}-\frac {\tanh ^{-1}(\sin (c+d x))}{8 a^2 d}+\frac {a}{12 d (a \sin (c+d x)+a)^3}-\frac {1}{4 d (a \sin (c+d x)+a)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + a*Sin[c + d*x])^2,x]

[Out]

-1/8*ArcTanh[Sin[c + d*x]]/(a^2*d) + a/(12*d*(a + a*Sin[c + d*x])^3) - 1/(4*d*(a + a*Sin[c + d*x])^2) + 1/(16*
d*(a^2 - a^2*Sin[c + d*x])) + 3/(16*d*(a^2 + a^2*Sin[c + d*x]))

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \frac {\tan ^3(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac {\text {Subst}\left (\int \frac {x^3}{(a-x)^2 (a+x)^4} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {1}{16 a (a-x)^2}-\frac {a}{4 (a+x)^4}+\frac {1}{2 (a+x)^3}-\frac {3}{16 a (a+x)^2}-\frac {1}{8 a \left (a^2-x^2\right )}\right ) \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac {a}{12 d (a+a \sin (c+d x))^3}-\frac {1}{4 d (a+a \sin (c+d x))^2}+\frac {1}{16 d \left (a^2-a^2 \sin (c+d x)\right )}+\frac {3}{16 d \left (a^2+a^2 \sin (c+d x)\right )}-\frac {\text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,a \sin (c+d x)\right )}{8 a d}\\ &=-\frac {\tanh ^{-1}(\sin (c+d x))}{8 a^2 d}+\frac {a}{12 d (a+a \sin (c+d x))^3}-\frac {1}{4 d (a+a \sin (c+d x))^2}+\frac {1}{16 d \left (a^2-a^2 \sin (c+d x)\right )}+\frac {3}{16 d \left (a^2+a^2 \sin (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.22, size = 70, normalized size = 0.67 \begin {gather*} -\frac {6 \tanh ^{-1}(\sin (c+d x))-\frac {3}{1-\sin (c+d x)}-\frac {4}{(1+\sin (c+d x))^3}+\frac {12}{(1+\sin (c+d x))^2}-\frac {9}{1+\sin (c+d x)}}{48 a^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + a*Sin[c + d*x])^2,x]

[Out]

-1/48*(6*ArcTanh[Sin[c + d*x]] - 3/(1 - Sin[c + d*x]) - 4/(1 + Sin[c + d*x])^3 + 12/(1 + Sin[c + d*x])^2 - 9/(
1 + Sin[c + d*x]))/(a^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 79, normalized size = 0.76

method result size
derivativedivides \(\frac {\frac {1}{12 \left (1+\sin \left (d x +c \right )\right )^{3}}-\frac {1}{4 \left (1+\sin \left (d x +c \right )\right )^{2}}+\frac {3}{16 \left (1+\sin \left (d x +c \right )\right )}-\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{16}-\frac {1}{16 \left (\sin \left (d x +c \right )-1\right )}+\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{16}}{d \,a^{2}}\) \(79\)
default \(\frac {\frac {1}{12 \left (1+\sin \left (d x +c \right )\right )^{3}}-\frac {1}{4 \left (1+\sin \left (d x +c \right )\right )^{2}}+\frac {3}{16 \left (1+\sin \left (d x +c \right )\right )}-\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{16}-\frac {1}{16 \left (\sin \left (d x +c \right )-1\right )}+\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{16}}{d \,a^{2}}\) \(79\)
risch \(\frac {i \left (-19 \,{\mathrm e}^{3 i \left (d x +c \right )}-12 i {\mathrm e}^{2 i \left (d x +c \right )}-3 \,{\mathrm e}^{i \left (d x +c \right )}+19 \,{\mathrm e}^{5 i \left (d x +c \right )}+40 i {\mathrm e}^{4 i \left (d x +c \right )}-12 i {\mathrm e}^{6 i \left (d x +c \right )}+3 \,{\mathrm e}^{7 i \left (d x +c \right )}\right )}{12 \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{6} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{2} d \,a^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 a^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 a^{2} d}\) \(162\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d/a^2*(1/12/(1+sin(d*x+c))^3-1/4/(1+sin(d*x+c))^2+3/16/(1+sin(d*x+c))-1/16*ln(1+sin(d*x+c))-1/16/(sin(d*x+c)
-1)+1/16*ln(sin(d*x+c)-1))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 110, normalized size = 1.06 \begin {gather*} \frac {\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 6 \, \sin \left (d x + c\right )^{2} - 7 \, \sin \left (d x + c\right ) - 2\right )}}{a^{2} \sin \left (d x + c\right )^{4} + 2 \, a^{2} \sin \left (d x + c\right )^{3} - 2 \, a^{2} \sin \left (d x + c\right ) - a^{2}} - \frac {3 \, \log \left (\sin \left (d x + c\right ) + 1\right )}{a^{2}} + \frac {3 \, \log \left (\sin \left (d x + c\right ) - 1\right )}{a^{2}}}{48 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/48*(2*(3*sin(d*x + c)^3 - 6*sin(d*x + c)^2 - 7*sin(d*x + c) - 2)/(a^2*sin(d*x + c)^4 + 2*a^2*sin(d*x + c)^3
- 2*a^2*sin(d*x + c) - a^2) - 3*log(sin(d*x + c) + 1)/a^2 + 3*log(sin(d*x + c) - 1)/a^2)/d

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 178, normalized size = 1.71 \begin {gather*} \frac {12 \, \cos \left (d x + c\right )^{2} - 3 \, {\left (\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (3 \, \cos \left (d x + c\right )^{2} + 4\right )} \sin \left (d x + c\right ) - 16}{48 \, {\left (a^{2} d \cos \left (d x + c\right )^{4} - 2 \, a^{2} d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) - 2 \, a^{2} d \cos \left (d x + c\right )^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/48*(12*cos(d*x + c)^2 - 3*(cos(d*x + c)^4 - 2*cos(d*x + c)^2*sin(d*x + c) - 2*cos(d*x + c)^2)*log(sin(d*x +
c) + 1) + 3*(cos(d*x + c)^4 - 2*cos(d*x + c)^2*sin(d*x + c) - 2*cos(d*x + c)^2)*log(-sin(d*x + c) + 1) - 2*(3*
cos(d*x + c)^2 + 4)*sin(d*x + c) - 16)/(a^2*d*cos(d*x + c)^4 - 2*a^2*d*cos(d*x + c)^2*sin(d*x + c) - 2*a^2*d*c
os(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan ^{3}{\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+a*sin(d*x+c))**2,x)

[Out]

Integral(tan(c + d*x)**3/(sin(c + d*x)**2 + 2*sin(c + d*x) + 1), x)/a**2

________________________________________________________________________________________

Giac [A]
time = 6.29, size = 102, normalized size = 0.98 \begin {gather*} -\frac {\frac {6 \, \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a^{2}} - \frac {6 \, \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a^{2}} + \frac {6 \, \sin \left (d x + c\right )}{a^{2} {\left (\sin \left (d x + c\right ) - 1\right )}} - \frac {11 \, \sin \left (d x + c\right )^{3} + 51 \, \sin \left (d x + c\right )^{2} + 45 \, \sin \left (d x + c\right ) + 13}{a^{2} {\left (\sin \left (d x + c\right ) + 1\right )}^{3}}}{96 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/96*(6*log(abs(sin(d*x + c) + 1))/a^2 - 6*log(abs(sin(d*x + c) - 1))/a^2 + 6*sin(d*x + c)/(a^2*(sin(d*x + c)
 - 1)) - (11*sin(d*x + c)^3 + 51*sin(d*x + c)^2 + 45*sin(d*x + c) + 13)/(a^2*(sin(d*x + c) + 1)^3))/d

________________________________________________________________________________________

Mupad [B]
time = 10.05, size = 240, normalized size = 2.31 \begin {gather*} \frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\frac {13\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{12}+\frac {10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{3}+\frac {13\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-10\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a^2\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,a^2\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3/(a + a*sin(c + d*x))^2,x)

[Out]

(tan(c/2 + (d*x)/2)/4 + tan(c/2 + (d*x)/2)^2 + (13*tan(c/2 + (d*x)/2)^3)/12 + (10*tan(c/2 + (d*x)/2)^4)/3 + (1
3*tan(c/2 + (d*x)/2)^5)/12 + tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^7/4)/(d*(4*a^2*tan(c/2 + (d*x)/2)^2 - 4
*a^2*tan(c/2 + (d*x)/2)^3 - 10*a^2*tan(c/2 + (d*x)/2)^4 - 4*a^2*tan(c/2 + (d*x)/2)^5 + 4*a^2*tan(c/2 + (d*x)/2
)^6 + 4*a^2*tan(c/2 + (d*x)/2)^7 + a^2*tan(c/2 + (d*x)/2)^8 + a^2 + 4*a^2*tan(c/2 + (d*x)/2))) - atanh(tan(c/2
 + (d*x)/2))/(4*a^2*d)

________________________________________________________________________________________